/*
 * ============================================================================
 * = COPYRIGHT
 *          PAX Computer Technology(Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
 *   This software is supplied under the terms of a license agreement or nondisclosure
 *   agreement with PAX Computer Technology(Shenzhen) Co., Ltd. and may not be copied or
 *   disclosed except in accordance with the terms in that agreement.
 *     Copyright (C) 2021 PAX Computer Technology(Shenzhen) Co., Ltd. All rights reserved.
 * ============================================================================
 */

import 'package:pigeon/pigeon.dart';


@ConfigurePigeon(PigeonOptions(
    dartOut: 'lib/auto_pigeon/poslink_sdk_batch.dart',
    javaOptions: JavaOptions(
      className: 'POSLinkBatch',
      package: 'com.example.pos_link.pigeon',
    ),
    objcOptions: ObjcOptions(prefix: ''),
    javaOut: './android/src/main/java/com/example/pos_link/pigeon/POSLinkBatch.java',
  ),
)
class BatchDeleteSafFileRequest {
  BatchSafIndicator? safIndicator;
}

class BatchSafUploadRequest {
  BatchSafIndicator? safIndicator;
}

class BatchDeleteTransactionRequest {
  BatchEdcType? edcType;
  BatchTransactionType? transactionType;
  BatchCardType? cardType;
  String? recordNumber;
  String? originalReferenceNumber;
  String? authorizationCode;
  String? ecrReferenceNumber;
  String? globalUid;
}

class BatchMultiMerchant {
  String? multiMerchantId;
  String? multiMerchantName;
}

class BatchBatchCloseRequest {
  String? timeStamp;
  BatchMultiMerchant? multiMerchant;
}

class BatchForceBatchCloseRequest {
  String? timeStamp;
}

class BatchPurgeBatchRequest {
  String? timeStamp;
}

class BatchBatchClearRequest {
  BatchEdcType? edcType;
}

class BatchTorResponse {
  BatchTorRecordType? recordType;
  String? reversalTimeStamp;
  String? hostResponseCode;
  String? hostResponseMessage;
  String? hostReferenceNumber;
  String? gatewayTransactionId;
  String? originalAmount;
  String? maskedPan;
  String? batchNumber;
  String? reversalAuthorizationCode;
  BatchTransactionType? originalTransactionType;
  String? originalTransactionDateTime;
  String? originalTransactionAuthorizationCode;
}

class BatchSafUploadResponse {
  String? responseCode;
  String? responseMessage;
  String? safTotalCount;
  String? safTotalAmount;
  String? timeStamp;
  String? safUploadedCount;
  String? safUploadedAmount;
  String? safFailedCount;
  String? safFailedTotal;
  BatchTorResponse? torInformation;
}

class BatchDeleteTransactionResponse {
  String? responseCode;
  String? responseMessage;
  BatchTorResponse? torInformation;
}

class BatchTotalAmount {
  String? creditAmount;
  String? debitAmount;
  String? ebtAmount;
  String? giftAmount;
  String? loyaltyAmount;
  String? cashAmount;
  String? checkAmount;
}

class BatchTotalCount {
  String? creditCount;
  String? debitCount;
  String? ebtCount;
  String? giftCount;
  String? loyaltyCount;
  String? cashCount;
  String? checkCount;
}

class BatchHostResponse {
  String? hostResponseCode;
  String? hostResponseMessage;
  String? authorizationCode;
  String? hostReferenceNumber;
  String? traceNumber;
  String? batchNumber;
  String? transactionIdentifier;
  String? gatewayTransactionId;
  String? hostDetailedMessage;
  String? transactionIntegrityClass;
  String? retrievalReferenceNumber;
  String? issuerResponseCode;
  String? paymentAccountReferenceId;
}

class BatchBatchCloseResponse {
  String? responseCode;
  String? responseMessage;
  BatchHostResponse? hostInformation;
  BatchTotalCount? totalCount;
  BatchTotalAmount? totalAmount;
  String? timeStamp;
  String? tid;
  String? mid;
  BatchMultiMerchant? multiMerchant;
  String? failedTransactionNumber;
  String? failedCount;
  String? safFailedCount;
  String? safFailedTotal;
  BatchTorResponse? torInformation;
}

class BatchPurgeBatchResponse {
  String? responseCode;
  String? responseMessage;
  BatchHostResponse? hostInformation;
  String? lineNumber;
  String? linesMessage;
  String? timeStamp;
  String? tid;
  String? mid;
  BatchTorResponse? torInformation;
}

class BatchBatchClearResponse {
  String? responseCode;
  String? responseMessage;
  BatchTorResponse? torInformation;
}

class BatchDeleteSafFileResponse {
  String? responseCode;
  String? responseMessage;
  String? safDeletedCount;
  BatchTorResponse? torInformation;
}

class BatchForceBatchCloseResponse {
  String? responseCode;
  String? responseMessage;
  BatchHostResponse? hostInformation;
  String? lineNumber;
  String? linesMessage;
  String? timeStamp;
  String? tid;
  String? mid;
  String? failedTransactionNumber;
  String? failedCount;
  String? safFailedCount;
  String? safFailedTotal;
  BatchTorResponse? torInformation;
}

enum BatchTorRecordType {
  NotSet,
  ReversalRecord,
  EmvSecondGacReversal,
}

enum BatchTransactionType {
  NotSet,
  Unknown,
  Sale,
  Return,
  Authorization,
  PostAuthorization,
  ForceAuthorization,
  Adjust,
  Withdrawal,
  Activate,
  Issue,
  Reload,
  Cashout,
  Deactivate,
  Replace,
  Merge,
  ReportLost,
  Void,
  VoidSale,
  VoidReturn,
  VoidAuthorization,
  VoidPostAuthorization,
  VoidForceAuthorization,
  VoidWithdrawal,
  Inquiry,
  Verify,
  Reactivate,
  ForcedIssue,
  ForcedAdd,
  Unload,
  Renew,
  GetConvertDetail,
  Convert,
  Tokenize,
  IncrementalAuthorization,
  BalanceWithLock,
  RedemptionWithUnlock,
  Rewards,
  Reenter,
  TransactionAdjustment,
  Transfer,
  Finalize,
  Deposit,
  AccountPayment,
  Reversal,
}

enum BatchEdcType {
  NotSet,
  All,
  Credit,
  Debit,
  Ebt,
  Gift,
  Loyalty,
  Cash,
  Check,
}

enum BatchCardType {
  NotSet,
  Visa,
  MasterCard,
  Amex,
  Discover,
  DinerClub,
  EnRoute,
  Jcb,
  RevolutionCard,
  VisaFleet,
  MasterCardFleet,
  FleetOne,
  Fleetwide,
  Fuelman,
  Gascard,
  Voyager,
  WrightExpress,
  Interac,
  Cup,
  Maestro,
  Sinclair,
  Other,
}

enum BatchSafIndicator {
  NotSet,
  NewStoredTransactionRecords,
  FailedTransactionRecords,
  DeleteAllSafRecords,
}

@HostApi()
abstract class POSLinkBatchApi {
   @async
   BatchBatchClearResponse batchClear(BatchBatchClearRequest req);
   @async
   BatchPurgeBatchResponse purgeBatch(BatchPurgeBatchRequest req);
   @async
   BatchForceBatchCloseResponse forceBatchClose(BatchForceBatchCloseRequest req);
   @async
   BatchBatchCloseResponse batchClose(BatchBatchCloseRequest req);
   @async
   BatchDeleteTransactionResponse deleteTransaction(BatchDeleteTransactionRequest req);
   @async
   BatchSafUploadResponse safUpload(BatchSafUploadRequest req);
   @async
   BatchDeleteSafFileResponse deleteSafFile(BatchDeleteSafFileRequest req);
}
